package com.fingard.dsp.bank.reqrespobj.batchbill;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.batchbill.detail.RetAtsOrgQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * @Author slience
 * @Date 2019/10/31 11:55
 * @Version
 */
public class RetAtsOrgQry extends RetAtsBase {

    public String respCode;
    public String respInfo;


    public RetAtsOrgQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }


    public void writeBefore() {
        writeStart();//写返回ATS的统一头部信息
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
    }

    public void writeAfter() {
        writeEnd();
    }

    public void writeDetail(RetAtsOrgQryDetail detail) {
        retXmlWriter.writeStartElement("DetailRecord");

        retXmlWriter.writeElementString("OrganId", detail.organId);
        retXmlWriter.writeElementString("OrganName", detail.organName);
        retXmlWriter.writeElementString("Reserved1", detail.reserved1);
        retXmlWriter.writeElementString("Reserved2", detail.reserved2);
        retXmlWriter.writeEndElement();
    }
}
